package arrayList_3_12;

public class Main {
    public static void main(String[] args) {
        MyArrayList list = new MyArrayList();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");
        System.out.println(list);
        list.add(5, "f");
        //list.add(8, "f");
        try {
            list.add(9, "f");
        }catch (IndexOutOfBoundsException e){
            e.printStackTrace();
        }
        System.out.println(list);
        list.add(0, "f");
        System.out.println(list);
        list.add(3, "f");
        System.out.println(list);
        list.remove(5);
        System.out.println(list);
        list.remove("f");
        System.out.println(list);

        System.out.println(list.get(4));
        list.set(4, "wang");
        System.out.println(list);
        System.out.println(list.contains("c"));
        System.out.println(list.subList(2, 5));
        list.clear();
        System.out.println(list);

    }
}
